public class OrderDetail {
    private int quantity;

    public OrderDetail(int quantity) {
        this.quantity = quantity;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public double calculateSubTotal(Product product) {
        return product.getPriceForQuantity(quantity);
    }

    public double calculateWeight(Product product) {
        return product.getWeight() * quantity;
    }
}
